package com.sz.biz.common.sup.service.impl;

import com.sz.biz.common.sup.entity.SupUserLoginInfo;
import com.sz.biz.common.sup.service.SupUserLoginInfoService;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;

/**
 * Function: TODO: ADD FUNCTION <br>
 * Author: Johnboy <br>
 * Date: 2017-10-13 14:39:00
 */
@Service
public class SupplierUserLoginInfoServiceImpl extends AbstractService implements SupUserLoginInfoService{

    @Override
    protected String getMapperNamespace() {
        return "SupUserLoginInfoMapper";
    }

    @Override
    public void updateUserLoginInfo(SupUserLoginInfo supUserLoginInfo) {
        SupUserLoginInfo uliTemp = (SupUserLoginInfo) dao.findForObject(getSqlName("selectByPrimaryKey"), supUserLoginInfo.getUserName());
        if (uliTemp == null) {
            dao.save(getSqlName("insert"), supUserLoginInfo);
        } else {
            dao.save(getSqlName("updateByPrimaryKey"), supUserLoginInfo);
        }
    }
}
